package ATM_mysql;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class ModifyPanel extends JPanel implements ActionListener {
    private ATM frame;
    private JLabel OldPwdLabel = new JLabel("原密码：");
    private JLabel newPwdLabel = new JLabel("新密码：");
    private JLabel pwdConfirmLabel = new JLabel("确认新密码：");
    private JPasswordField oldPwdField = new JPasswordField();
    private JPasswordField newPwdField = new JPasswordField();
    private JPasswordField pwdConfirmTextField = new JPasswordField();
    private JButton backBtn = new JButton(Util.getIcon("/images/buttonOff.jpg"));
    private JButton modifyBtn = new JButton(Util.getIcon("/images/buttonModify.jpg"));
    private Font font = new Font("宋体", Font.BOLD, 25);

    public ModifyPanel(ATM frame) {
        this.frame = frame;
        this.setLayout(null);
        this.setOpaque(false);

        //原密码提示设置
        OldPwdLabel.setBounds(40, 400, 200, 50);
        OldPwdLabel.setFont(font);
        this.add(OldPwdLabel);
        //原密码输入框设置
        oldPwdField.setBounds(200, 400, 200, 50);
        oldPwdField.setFont(font);
        this.add(oldPwdField);

        newPwdLabel.setBounds(40, 450, 200, 50);
        newPwdLabel.setFont(font);
        this.add(newPwdLabel);

        newPwdField.setBounds(200, 450, 200, 50);
        newPwdField.setFont(font);
        this.add(newPwdField);

        pwdConfirmLabel.setBounds(40, 500, 200, 50);
        pwdConfirmLabel.setFont(font);
        this.add(pwdConfirmLabel);

        pwdConfirmTextField.setBounds(200, 500, 200, 50);
        pwdConfirmTextField.setFont(font);
        this.add(pwdConfirmTextField);

        modifyBtn.setBounds(40, 550, 140, 50);
        modifyBtn.addActionListener(this);
        this.add(modifyBtn);

        backBtn.setBounds(240, 550, 140, 50);
        backBtn.addActionListener(this);
        this.add(backBtn);
    }

    @Override
    public void actionPerformed(ActionEvent e) {

    }
}
